﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="companyGroupList.aspx.cs"
    Inherits="PeisongWeb.admin.companyGroupList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>企业组配置 - 想购网长期采购物流配送系统</title>
    <!--#include file="style.inc"-->
    <script type="text/javascript">
        function resetSrh(){
            document.getElementById('txt_companyName').value="";
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            企业组配置
        </h2>
        <span>
            <ext:Button runat="server" ID="btnAddGroup" Icon="Add" Text="新建分组" AutoPostBack="true" OnClick="btnAddGroup_Click">
            </ext:Button>
        </span>
        <p>&nbsp;</p>
        <ext:Panel ID="Panel1" runat="server" Title="企业搜索" BodyStyle="padding:5px 5px 0"
            Width="1200" Frame="true" ButtonAlign="Center">
            <Body>
                <div id="admin_edit_content_search">
                    <ul>
                        <li>
                            <label>
                                公司名称
                            </label>
                            <asp:TextBox runat="server" ID="txt_companyName"></asp:TextBox>
                        </li>
                        <li>
                            <label>
                                &nbsp;
                            </label>
                            [<asp:LinkButton ID="lbtn_Search" runat="server" Text="搜 索" OnClick="lbtn_Search_Click">
                            </asp:LinkButton>]&nbsp;&nbsp;&nbsp; [<a href="javascript:resetSrh();">重 置</a>]
                        </li>
                    </ul>
                </div>
            </Body>
        </ext:Panel>
        <p>&nbsp;</p>
        <div id="admin_list_content" style="width: 1200px;">
            <table cellpadding="0" cellspacing="0">
                <tr class="header-row">
                    <th>
                        编 号
                    </th>
                    <th>
                        名 称
                    </th>
                    <th>所属分组</th>
                    <th>
                        联系人
                    </th>
                    <th>
                        编辑分组
                    </th>
                </tr>
                <asp:Repeater ID="rpt_list" runat="server" OnItemCommand="rpt_ItemCommand">
                    <ItemTemplate>
                        <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                            <td>
                                <%# Eval("companyNo")%>
                            </td>
                            <td>
                                <%# Eval("companyName")%>
                            </td>
                            <td><%# DataBinder.Eval(Container.DataItem,"groupName") %></td>
                            <td>
                                <%# Eval("contact")%>
                            </td>
                            <td>
                                <asp:LinkButton runat="server" ID="linkEditGroup" CommandName="EditGroup" CommandArgument='<%# String.Format("{0},{1}",DataBinder.Eval(Container.DataItem,"companyId"),DataBinder.Eval(Container.DataItem,"groupId")) %>'>编辑分组</asp:LinkButton>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <div id="page">
                <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                    OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="20"
                    InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                    ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                    CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                    LastPageText="末页" PrevPageText="上一页">
                </webdiyer:AspNetPager>
            </div>
        </div>
    </div>
    <ext:Window runat="server" ID="winGroup" Title="新建分组"  BodyStyle="padding:5px;" ShowOnLoad="false" Resizable="false" Draggable="false" Modal="true" Width="385px" Height="105px">
        <Body>
            <ext:FormLayout runat="server" Width="100">
                <ext:Anchor Horizontal="100%">
                    <ext:TextField ID="txtGroupName" runat="server" FieldLabel="组名"></ext:TextField>
                </ext:Anchor>
            </ext:FormLayout>
        </Body>
        <Buttons>
            <ext:Button runat="server" ID="btnSaveGroup" Text="保存" Icon="Accept" OnClick="btnSaveGroup_Click" AutoPostBack="true"></ext:Button>
        </Buttons>
    </ext:Window>
    <ext:Store runat="server" ID="stCommpanyGroup">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="groupId"></ext:RecordField>
                    <ext:RecordField Name="groupName"></ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Window runat="server" ID="winAddToGroup" Title="加入到分组" BodyStyle="padding:5px;" ShowOnLoad="false" Resizable="false" Draggable="false" Modal="true" Width="385px" Height="105px">
        <Body>
            <ext:FormLayout runat="server" Width="100">
                <ext:Anchor Horizontal="100%">
                    <ext:ComboBox runat="server" ID="cboCompanyGroup" Width="300px" AllowBlank="false" FieldLabel="所属分组"
                        Editable="false" Mode="Local" TypeAhead="true" ForceSelection="true" TriggerAction="All"
                        SelectOnFocus="true" StoreID="stCommpanyGroup" BlankText="请选择企业所属组!">
                    </ext:ComboBox>
                </ext:Anchor>
            </ext:FormLayout>
        </Body>
        <Buttons>
            <ext:Button runat="server" ID="btnSaveCompanyGroup" Text="保存" Icon="Accept" OnClick="btnSaveCompanyGroup_Click" AutoPostBack="true"></ext:Button>
        </Buttons>
    </ext:Window>
    </form>
</body>
</html>
